function check_login(){
	$.ajax({
		type:'POST',
		url:'login.php',
		data:"username="+$('#login-username').val()+"&password="+$('#login-password').val(),
		error: function(request, status, error) {
			 alert(request.responseText);
		},
		success:function(response){
			if(response=='1'){
				location.reload();
			} else if(response=='2'){
				error_report("Error Logging In", "Invalid Username or Password. Please try again.");
			}
		}
	});
};

function logout(){
	$.ajax({
		type:'POST',
		url:'resources/logout.php',
		error: function(request, status, error) {
			 alert(request.responseText);
		},
		success:function(response){
			if(response == 1)
				location.href = "index.php";
		}
	});
};